* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: transparent;
    min-height: 100vh;
}

/* ========== 头部样式 ========== */
header {
    background: var(--bg-gradient);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav {
    display: flex;
    gap: 0.75rem;
}

.nav-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
    background-color: white;
    color: var(--primary-color);
    border-color: white;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* ========== 页面样式 ========== */
.page {
    display: none;
    padding: 2.5rem;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid rgba(102, 126, 234, 0.1);
}

.page-header h2 {
    color: var(--text-dark);
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.page-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50%;
    height: 4px;
    background: var(--bg-gradient);
    border-radius: 2px;
}

/* ========== 按钮样式 ========== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #a8b8c2 0%, #8e9eab 100%);
    color: white;
}

.btn-secondary:hover {
    box-shadow: 0 4px 15px rgba(142, 158, 171, 0.4);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

/* ========== 新闻列表样式 ========== */
.news-list {
    display: grid;
    gap: 2rem;
}

.news-item {
    background: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.news-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--bg-gradient);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.news-item:hover::before {
    transform: scaleY(1);
}

.news-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.news-item h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.news-item:hover h3 {
    color: var(--primary-color);
}

.news-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.news-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.news-meta span::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 0.3rem;
}

.news-preview {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 0.95rem;
}

/* 搜索高亮样式 */
.news-item em,
.news-item span[style*="color"] {
    font-style: normal;
    padding: 2px 4px;
    border-radius: 4px;
}

.news-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.no-news,
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-size: 1.2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    line-height: 2;
}

.no-news small,
.no-results small {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.7;
}

/* ========== 搜索容器样式 ========== */
.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    align-items: stretch;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), var(--shadow-md);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: var(--text-light);
}

/* ========== 表单样式 ========== */
.news-form {
    max-width: 700px;
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

textarea.form-control {
    resize: vertical;
    min-height: 200px;
}

/* 分类输入框样式 */
input[list] {
    cursor: pointer;
}

input[list]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

/* 为分类输入框添加下拉提示 */
#newsCategory {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
}

/* ========== 模态框样式 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 3rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
    transform: rotate(90deg);
}

#newsDetailContent h2 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    padding-bottom: 1rem;
    border-bottom: 3px solid rgba(102, 126, 234, 0.2);
}

#newsDetailContent .news-detail-meta {
    color: var(--text-light);
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

#newsDetailContent .news-detail-meta p {
    margin-bottom: 0.5rem;
}

#newsDetailContent .news-detail-content {
    line-height: 2;
    white-space: pre-wrap;
    color: var(--text-dark);
    font-size: 1.05rem;
}

/* ========== 消息提示样式 ========== */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: var(--success-color);
    color: white;
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    display: none;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    animation: slideInRight 0.4s ease;
    min-width: 300px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast::before {
    content: '✓';
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.toast.error {
    background: var(--danger-color);
}

.toast.error::before {
    content: '✕';
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-btn {
        flex: 1;
        min-width: 100px;
    }

    .page {
        padding: 1.5rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .search-container {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .news-item {
        padding: 1.5rem;
    }

    .news-item h3 {
        font-size: 1.3rem;
    }

    .news-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .news-actions {
        flex-direction: column;
    }

    .news-actions .btn {
        width: 100%;
        text-align: center;
    }

    .news-form {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .modal-content {
        margin: 15% auto;
        width: 95%;
        padding: 2rem 1.5rem;
    }

    .toast {
        right: 15px;
        left: 15px;
        min-width: auto;
    }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== 加载动画 ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
